package com.greencloud.gcstaffmanagment.service.impl;

import com.greencloud.framework.springboot.common.dal.dto.Pager;
import com.greencloud.framework.springboot.common.dal.helper.PagerHelper;
import com.greencloud.gcstaffmanagement.dto.QueryEmployeeListParamDTO;
import com.greencloud.gcstaffmanagment.service.IEmployeeService;
import com.greencloud.gcstaffmanagement.mapper.EmployeeDOMapper;
import com.greencloud.gcstaffmanagement.model.EmployeeDO;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("employeeService")
public class EmployeeService implements IEmployeeService {

    @Autowired
    private EmployeeDOMapper employeeDOMapper;

    @Autowired
    private ModelMapper modelMapper;

    @Override
    public List<EmployeeDO> pager(QueryEmployeeListParamDTO queryEmployeeListParamDTO) {
        return employeeDOMapper.findEmployeePage(queryEmployeeListParamDTO);
    }

    @Override
    public Integer save(EmployeeDO employeeDO) {
        return employeeDOMapper.insert(employeeDO);
    }
}
